package com.xiangxiao.rpan.authority.service.impl;

import com.xiangxiao.rpan.authority.dao.UserMapper;
import com.xiangxiao.rpan.authority.service.UserService;
import com.xiangxiao.rpan.authority.vo.UserVo;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @auther xiangxiao
 * @email 573768011@qq.com
 * @data 2023/3/25 16:23
 */
@Service
public class UserserviceImpl implements UserService {
  @Autowired
  private UserMapper userMapper;

  @Override
  public UserVo findUserByAccount(String account) {
    List<UserVo> userByAccount = userMapper.findUserByAccount(account);
    if (CollectionUtils.isEmpty(userByAccount)) {
      return null;
    }

    return userByAccount.get(0);
  }
}
